import java.util.ArrayList;
import java.util.Random;

public class Manager extends Person{
    public Manager(String username, int moeny){
        super( username,  moeny);
    }
    public Manager(){

    }


    public ArrayList<Integer> send(int totalMoeny, int count){
        ArrayList<Integer>  redList=new ArrayList<Integer>();

        int leftMoney=super.getMoeny();
        if(totalMoeny>leftMoney){
            System.out.println("余额不足");
            return redList;
        }

        this.setMoeny(leftMoney-totalMoeny);
        int m;
        int j=totalMoeny;
        Random random=new Random();
for (int i=0;i<count-1;i++){
    m=j/(count-i);
    int mm= random.nextInt(m*2)+1;
    redList.add(mm);
    j=j-mm;
}
    int last=j;
redList.add(j);
        return redList;
    }

}
